]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Do not launch power statistics app from battery items
authorWilliam Jon McCann <jmccann@redhat.com>
Wed, 2 Mar 2011 01:03:25 +0000 (20:03 -0500)
committerWilliam Jon McCann <jmccann@redhat.com>
Thu, 3 Mar 2011 20:44:38 +0000 (15:44 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=640768

js/ui/status/power.js

index f3625cc2d2d041489712cec87c76aecfae7c8437..fabb181877390959538cede61a55b91e6c3175eb 100644 (file)
@@ -72,7 +72,7 @@ Indicator.prototype = {
         this._hasPrimary = false;
         this._primaryDeviceId = null;
 
-        this._batteryItem = new PopupMenu.PopupMenuItem('');
+        this._batteryItem = new PopupMenu.PopupMenuItem('', { reactive: false });
         this._primaryPercentage = new St.Label();
         this._batteryItem.addActor(this._primaryPercentage, { align: St.Align.END });
         this.menu.addMenuItem(this._batteryItem);
@@ -136,17 +136,6 @@ Indicator.prototype = {
             }
 
             this._primaryDeviceId = device_id;
-            if (this._primaryDeviceId) {
-                this._batteryItem.actor.reactive = true;
-                this._batteryItem.actor.can_focus = true;
-                this._batteryItem.connect('activate', function(item) {
-                    Util.spawn(['gnome-power-statistics', '--device', device_id]);
-                });
-            } else {
-                // virtual device
-                this._batteryItem.actor.reactive = false;
-                this._batteryItem.actor.can_focus = false;
-            }
         }));
     },
 
@@ -168,9 +157,6 @@ Indicator.prototype = {
                     continue;
 
                 let item = new DeviceItem (devices[i]);
-                item.connect('activate', function() {
-                    Util.spawn(['gnome-power-statistics', '--device', device_id]);
-                });
                 this._deviceItems.push(item);
                 this.menu.addMenuItem(item, this._otherDevicePosition + position);
                 position++;
@@ -216,7 +202,7 @@ DeviceItem.prototype = {
     __proto__: PopupMenu.PopupBaseMenuItem.prototype,
 
     _init: function(device) {
-        PopupMenu.PopupBaseMenuItem.prototype._init.call(this);
+        PopupMenu.PopupBaseMenuItem.prototype._init.call(this, { reactive: false });
 
         let [device_id, device_type, icon, percentage, state, time] = device;